var i = getApp(), t = [ "价格详谈", "100元", "200元", "300元", "400元", "500元", "600元", "700元", "800元", "900元", "1000元", "1100元", "1200元", "1300元", "1400元", "1500元", "1600元", "1700元", "1800元", "1900元", "2000元", "2200元", "2400元", "2600元", "2800元", "3000元", "3200元", "3400元", "3600元", "3800元", "4000元", "4200元", "4400元", "4600元", "4800元", "5000元", "5500元", "6000元", "6500元", "7000元", "7500元", "8000元", "8500元", "9000元", "9500元", "10000元", "11000元", "12000元", "13000元", "14000元", "15000元", "16000元", "17000元", "18000元", "19000元", "20000元", "22000元", "24000元", "26000元", "28000元", "30000元", "35000元", "40000元", "45000元", "50000元" ];

Component({
    properties: {},
    data: {
        isHidden: !0,
        prices: t,
        minPrice: "",
        maxPrice: "",
        minPriceIndex: -1,
        maxPriceIndex: -1
    },
    methods: {
        hide: function() {
            this.setData({
                isHidden: !0
            });
        },
        show: function() {
            this.setData({
                isHidden: !1
            });
        },
        _clickMinPrice: function(i) {
            var t = i.currentTarget.dataset.index;
            this.setData({
                minPrice: this.data.prices[t],
                minPriceIndex: t
            }), 0 == t ? this.setData({
                maxPrice: this.data.prices[0],
                maxPriceIndex: 0
            }) : 0 == this.data.maxPriceIndex && this.setData({
                maxPrice: "",
                maxPriceIndex: -1
            });
        },
        _clickMaxPrice: function(i) {
            var t = i.currentTarget.dataset.index;
            this.setData({
                maxPrice: this.data.prices[t],
                maxPriceIndex: t
            }), 0 == t ? this.setData({
                minPrice: this.data.prices[0],
                minPriceIndex: 0
            }) : 0 == this.data.maxPriceIndex && this.setData({
                minPrice: "",
                minPriceIndex: -1
            });
        },
        _clickConfirm: function(t) {
            -1 == this.data.minPriceIndex ? i.util.showToast("请选择最低合作价") : -1 == this.data.maxPriceIndex ? i.util.showToast("请选择最高合作价") : this.data.maxPriceIndex < this.data.minPriceIndex ? i.util.showToast("最高合作价不能低于最低合作价") : this.triggerEvent("confirm", {
                minPrice: this.data.minPrice,
                maxPrice: this.data.maxPrice
            });
        }
    }
});